import request from '#/utils/requestAbort';

export async function fetchProvinces() {
  // 获取省份选择列表，暂时只能获取到山西的信息
  return request(`/disclosure/maltm/historySequences/provinces`);
}

export async function fetchSequenceList(params) {
  // 获取序列列表
  return request(`/disclosure/maltm/historySequences/sequenceList`, {
    params: params,
  });
}

export async function fetchCentralizedBiddingInfos(sequenceId) {
  // 获取历史集中竞价序列出清数据
  return request(`/disclosure/maltm/historySequences/centralizedBiddingInfos/${sequenceId}`);
}

export async function fetchRollingBatchInfos(sequenceId) {
  // 获取历史滚动撮合序列出清数据
  return request(`/disclosure/maltm/historySequences/rollingBatchInfos/${sequenceId}`);
}

export async function fetchSequenceAccounted(params) {
  // 获取历史滚动撮合序列出清数据
  return request(`/disclosure/longTermPointClearingResult/getSequenceAccounted`, {
    method: 'POST',
    data: params,
  });
}

export async function fetchGetStationLevelThree(params) {
  // 获取场站交易单元树
  return request(`/power/station/getStationLevelThree`, {
    method: 'POST',
    data: params,
  });
}

export async function fetchGetLongTermForecastPrice(params) {
  // 获取长周期日前电价
  return request(`/disclosure/influenceFactor/longTermForecastPrice`, {
    method: 'POST',
    data: params,
  });
}

export async function fetchGetLongTermForecastSupply(params) {
  // 获取长周期供需预测
  return request(`/disclosure/influenceFactor/longTermForecastSupply`, {
    method: 'POST',
    data: params,
  });
}

export async function fetchGetHistoryDayAheadPrice(params) {
  // 获取历史日前电价
  return request(`/disclosure/influenceFactor/historyDayAheadPrice`, {
    method: 'POST',
    data: params,
  });
}

export async function fetchGetMarketSupDemRelation(params) {
  // 获取市场供需关系
  return request(`/disclosure/influenceFactor/marketSupDemRelation`, {
    method: 'POST',
    data: params,
  });
}

export async function fetchGetSteamCoalMarket(params) {
  // 获取动力煤市场行情
  return request(`/disclosure/influenceFactor/steamCoalMarket`, {
    method: 'POST',
    data: params,
  });
}

// 省份-交易中心-场站（数据权限）
export async function queryMarketList(menuCode) {
  return request(`/power/dataPower/common/${menuCode}/t_station`, {
    method: 'GET',
  });
}

export async function windSteamCoalFuture() {
  // 获取动力煤列表
  return request('/disclosure/windSteamCoalFuture', {
    method: 'GET',
  });
}
export async function getMarketSituation(name) {
  // 获取动力煤市场行情
  return request(`/disclosure/windSteamCoalFuture/marketSituation/${name}`, {
    method: 'GET',
  });
}

// 导入
export async function importList(data) {
  return request(`/disclosure/maltm/importLongTermExcel`, {
    method: 'POST',
    data,
  });
}

// 导入模板下载
export async function getTemplate(longTermType) {
  return request(`/disclosure/maltm/templateDownLoad?longTermType=${longTermType}`, {
    method: 'GET',
    responseType: 'blob',
  });
}
